package com.zzq.controller;

import com.zzq.domain.search.PhotographerWithdrawalRecordSearchParamet;
import com.zzq.result.SmileResult;
import com.zzq.service.WithdrawAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/admin/withdraw")
@RestController
@Api(value = "提现管理", tags = {"提现管理"})
public class WithdrawAdminController {


    @Autowired
    WithdrawAdminService withdrawAdminService;
    /**
     * 提现申请列表
     * @return
     */
    @PostMapping("/list")
    @ApiOperation("获取列表")
    public SmileResult withdrawApplyList(@RequestBody PhotographerWithdrawalRecordSearchParamet searchParamet){
       return withdrawAdminService.list(searchParamet);
    }

    @GetMapping("/audit")
    @ApiOperation("审核")
    public SmileResult audit(@RequestParam("photographerWithdrawalRecordId") Long   photographerWithdrawalRecordId, @RequestParam("audit") Boolean   isby){
        return   withdrawAdminService.setAudit(photographerWithdrawalRecordId,isby);
    }
    @GetMapping("/bankno")
    @ApiOperation("获取银行卡号")
    public SmileResult bankno(@RequestParam("photographerId") Long   photographerId){
        return   withdrawAdminService.getBankNo(photographerId);
    }
    @GetMapping("/payment")
    @ApiOperation("支付提成")
    public SmileResult audit(@RequestParam("photographerWithdrawalRecordId") Long   photographerWithdrawalRecordId){
        return   withdrawAdminService.withdrawPayment(photographerWithdrawalRecordId);
    }
}
